package org.duoyi.striver.service.post;

import lombok.extern.slf4j.Slf4j;
import org.duoyi.striver.consts.Area;
import org.duoyi.striver.consts.Picture;
import org.duoyi.striver.consts.Shortcuts;
import org.duoyi.striver.service.Task;
import org.duoyi.striver.service.TaskPost;

@Slf4j
public class SkillPost extends TaskPost {

    private int skillIndex;

    public SkillPost(Task target, int skillIndex) {
        super("技能选择", target);
        this.skillIndex = skillIndex;
    }

    @Override
    public void doPost() {
        //打开技能面板
        if (!Picture.挂机界面.find()) {
            Shortcuts.挂机界面.press();
        }
        Area.挂机界面_战斗设置.leftClick();
        log.info("选择技能-{}", skillIndex);
        Area.战斗设置_技能列表.leftClick();
        Area area = Area.valueOf("战斗设置_技能" + skillIndex);
        area.leftClick();
        Shortcuts.Esc.press();
    }

}
